// import { stringify } from "querystring";

const asyncRoutes = [
  // {
  //   path: 'manual-operate',
  //   url: '/bdc/manual-operate/index',
  //   name: 'ManualOperate',
  //   meta: { title: '报表demo页' }
  // },
  {
    path: 'line-monitor',
    url: '/bdc/line-monitor/index',
    name: 'LineMonitor',
    meta: { title: '生产线监控' }
  },
  {
    path: 'route-mode-ctrl',
    url: '/bdc/route-mode-ctrl/index',
    name: 'RouteModeCtrl',
    meta: { title: '手动路由控制' }
  },
  {
    path: 'startup-rate-monitor',
    url: '/bdc/startup-rate-monitor/index',
    name: 'StartupRateMonitor',
    meta: { title: '开动率监控' }
  },
  {
    path: 'route-log',
    url: '/bdc/route-log/index',
    name: 'RouteLog',
    meta: { title: '路由日志' }
  },
  {
    path: 'order-rule',
    url: '/bdc/order-rule/index',
    name: 'OrderRule',
    meta: { title: '进涂装排序规则' }
  },
  {
    path: 'painting-workshop-monitor',
    url: '/bdc/painting-workshop-monitor',
    name: 'PaintingWorkshopMonitor',
    meta: { title: '涂装产线监控', roles: ['admin', 'editor'] }
  }
]
export default [
  // 查询
  {
    url: '/asyncRoutes/route',
    type: 'get',
    response: config => {
      // const res = config.query
      // let data = [].concat(list)
      // if (res.workshop && res.workshop !== '') {
      //   data = data.filter(a => a.workshop.indexOf(res.workshop) >= 0)
      // }
      // if (res.dateTime && res.dateTime !== null) {
      //   data = data.filter(a => a.dateTime > new Date(res.dateTime).valueOf() && Number(a.dateTime) - new Date(res.dateTime).valueOf() < 24 * 3600 * 1000)
      // }
      return {
        code: 20000,
        data: asyncRoutes,
        message: 'success'
      }
    }
  }
]
